package cn.gym.service;

import cn.gym.dao.CustomerMapper;
import cn.gym.pojo.Customer;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("customerService")
public class CustomerServiceImpl implements CustomerService {
    @Resource
    private CustomerMapper customerMapper;

    public CustomerMapper getCustomerMapper() {
        return customerMapper;
    }

    public void setCustomerMapper(CustomerMapper customerMapper) {
        this.customerMapper = customerMapper;
    }


    @Override
    public boolean register(Customer customer) {
        int isReg=0;
        boolean flag=false;
        try {
            isReg=customerMapper.insert(customer);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if(isReg>0){
            flag=true;
        }
        return flag;
    }
}
